import http from "@/utils/http"
/**
 * 小程序登录
 */

export const postLoginWxMin = (data) => {
    return http({
        url: "/login/wxMin",
        method: "post",
        data
    })
}


/**
 * 不是企业账户 测试可用登录
 */

export const postTestLoginWxMin = (phoneNumber) => {
    return http({
        url: '/login/wxMin/simple',
        method: "post",
        data: { phoneNumber }
    })
}

/**
 * 获取个人信息
 */

export const getMemberProfile = () => {
    return http({
        url: '/member/profile',
    })
}

/**
 * 小程序修改头像 写法 调用普通的数据接口  wx.request  ，文件上传 用 wx.uploadFile
 */
export const postMemberProfileAvatar = (filePath) =>{
    return uni.uploadFile({
        url:"/member/profile/avatar",
        filePath,
        name:"file"
    })
}

/**
 * 个人信息-修改
 */

export const putMemberProfile  = (data) => {
    return http({
        url: "/member/profile",
        method: "put",
        data
    })
}
